Skip to content

Add syntax highlighting for the Actions lockfile (actions.lock) - #643

Open
nodeselector wants to merge 3 commits into
nodeselector-ci-skip-playwright-browserfrom
nodeselector-vscode-actions-lock-pr
Open

nodeselector wants to merge 3 commits into
nodeselector-ci-skip-playwright-browserfrom
nodeselector-vscode-actions-lock-pr

Conversation

@nodeselector

@nodeselector nodeselector commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor
  • Adds a GitHub Actions Lockfile language for .github/workflows/actions.lock, the dependency lockfile written by gh actions-lock. Today the file opens as Plain Text.
  • Reuses the bundled workflow YAML grammar and injects scopes for action pins (owner/repo@ref, including refs with / or #, and , in quoted pins) and commit digests (sha1-…, sha256-…), so they stand out from the rest of the YAML. Comments are left alone.
  • Purely declarative: new languages and grammars contributions and two grammar files. No new activation events or extension code.
  • Schema validation isn't included. The format's JSON Schema (github/actions-lockfile) has no hosted URL yet, and YAML schema hooks don't apply to a dedicated language. gh actions-lock --verify remains the validator.

Before: actions.lock as Plain Text. After: GitHub Actions Lockfile with pins and digests highlighted

Testing: built, linted and ran the unit tests, including a new grammar test for refs containing # and ,. I installed the packaged extension in VS Code 1.143 and opened the lockfile from github/gh-actions-lock (format v0.0.3): it now opens as GitHub Actions Lockfile with pins, refs and digests highlighted, and workflow files are unchanged. I also tokenized edge cases (a hostname field, release/v1 refs, sha256 digests, and pins inside comments) and all scoped correctly.

@nodeselector
nodeselector requested a review from a team as a code owner November 25, 2026 21:52
Copilot AI adaptive review requested due to automatic review settings November 25, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The grammar truncates valid quoted Git refs containing # or ,, leaving the remainder without its intended highlighting.

1 open issue
What changed in this PR

Adds syntax highlighting for .github/workflows/actions.lock using the extension’s existing workflow YAML grammar, without new activation events or runtime code.

Changes:

  • Registers a dedicated GitHub Actions Lockfile language.
  • Adds highlighting scopes for action pins, refs, and commit digests.
  • Documents lockfile highlighting in the README; schema validation remains out of scope.
File Description
README.md Documents Actions lockfile highlighting.
package.json Registers the lockfile language and grammars.
language/​syntaxes/​lockfile.tmLanguage.json Reuses the workflow YAML grammar for lockfiles.
language/​syntaxes/​lockfile.tmGrammar.json Adds pin and digest scopes while excluding comments.

Review effort: Balanced (adaptive)

Registers a GitHub Actions Lockfile language for
.github/workflows/actions.lock that reuses the bundled YAML grammar and
injects scopes for action pins (owner/repo@ref) and commit digests.
Git refs may contain # and ,. Quoted pins now color the whole ref. Plain pins keep # (YAML only starts a comment after whitespace) but still stop at , so flow sequences split correctly.
@nodeselector
nodeselector changed the base branch from main to nodeselector-ci-skip-playwright-browser November 25, 2026 22:39
@nodeselector
nodeselector added this pull request to stack #645 November 25, 2026 22:39
@nodeselector
nodeselector force-pushed the nodeselector-vscode-actions-lock-pr branch from 49fa5c8 to eb3ce99 Compare November 25, 2026 22:39

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants